<br/><h1>Cписок вопросов и ответов</h1>

<div id="otzivlist">

<?php

	$mode="priemnaya";
	$rname="priemnaya";
	
	//$title="„писок сопутствующих услуг компании";
	$pagenav=1;
	
	$CatID="";
	
	$where=" is_moderated=1";
	
	
	if (!empty($_GET['page'])) { 
		$page=intval($_GET['page']);
		//$page=explode("p-", $page);
		//$page=$page[1];
	}//if
	if (empty($page)) $page=0;
	
	$NumPerPage = "10";
	
	
	$limit[0]=$page*$NumPerPage;
	$limit[1]=$NumPerPage;
	
	$order=" - adddate";
	
	$numall=GetElementsByCatID($rname, $CatID, $order="", $limit="", $where);
	if (!empty($numall)) $pnav_numall=count($numall);
	
	$NewsData = GetElementsByCatID($rname, $CatID, $order, $limit, $where);
	
	//echo("<pre>");
	//print_r($NewsData);
	//echo("</pre>");

	if (!empty($NewsData)) {
	
		if (empty($Url)) $Url="";
	
	//выводим постраничку
	if (!empty($numall) and !empty($pnav_numall)) echo pagenav($pnav_numall, $page, $Url, $NumPerPage);
	//echo("<br/><br/>");
	
	foreach ($NewsData as $otz) {
?>

	<div class="otziv">
		
			<div class="otzname"><strong><?php echo $otz['user_name'];?></strong></div>
			<div class="otzdate">дата внесения: <?php echo mydate($otz['adddate'], 1);?></div>
			<div class="clearfix"></div>
			<div class="otztext">
			<?php echo nl2br($otz['otziv_text']);?>
				<?php 
				if (!empty($otz['answ_text'])) {
				?>
				<div class="otzansw"><div class="answ">ответ администратора:</div> <?php echo $otz['answ_text'];?></div>
				<?php
				}//if (!empty($otz['answ_text'])) {
				?>
			</div>
		
	</div>
	
<?php
	}//foreach ($NewsData as $otz) {
?>

<div class="clearfix"></div>
<br/>


<?php
	if (!empty($numall) and !empty($pnav_numall)) echo pagenav($pnav_numall, $page, $Url, $NumPerPage);
	
	}//if (!empty($NewsData)) {
?>

</div>